﻿using System;
using System.Linq;
using System.Linq.Expressions;
using Webdiyer.AspNetCore;
using PlatformNetCore.Entity;
using PlatformNetCore.IRepository;

namespace PlatformNetCore.Repository
{
    public class SinglePageRepository : Repository<SinglePage>, ISinglePageRepository
    {
        public SinglePageRepository(PlatformContext dbContext) : base(dbContext)
        {

        }

        public override PagedList<SinglePage> GetPagedList(int pageIndex, int pageSize, Expression<Func<SinglePage, bool>> predicate)
        {
            return _dbContext.SinglePage.Where(predicate).OrderBy(m => m.SortNo).ToPagedList(pageIndex, pageSize);
        }
    }
}
